package net.fiodor.log {
	import net.fiodor.collections.hash.HashMap;			

	/**
	 * @author Tomasz Swierszcz, 
	 * email: tomasz.swierszcz@dreamlab.pl
	 */
	 
	public class Log {

		private static var __logLevel : LogLevel = LogLevel.ALL;
		private static var __loggers : HashMap = new HashMap();

		public static function getLogger( loggerCategory : String ) : Logger {
		
			loggerCategory = loggerCategory ? loggerCategory : "LOG";
			if( __loggers.containsKey(loggerCategory) ) {
			
				return __loggers.get(loggerCategory) as Logger;	
			}	
			var logger : Logger = new Logger(loggerCategory);
			__loggers.put(loggerCategory, logger);
			return logger;
		}

		public static function setLogLevel( level : LogLevel ) : void {
		
			__logLevel = level;	
		}

		public static function getLogLevel() : LogLevel {
	
			return __logLevel;	
		}
	}
}
